Optimal. Leaf size=65 \[ -\frac {2 \sqrt {\frac {1-\cos (x)}{a-\cos (x)}} \sqrt {a-\cos (x)} \tan ^{-1}\left (\frac {\sin (x)}{\sqrt {1-\cos (x)} \sqrt {a-\cos (x)}}\right )}{\sqrt {1-\cos (x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {4400, 2775, 204} \[ -\frac {2 \sqrt {\frac {1-\cos (x)}{a-\cos (x)}} \sqrt {a-\cos (x)} \tan ^{-1}\left (\frac {\sin (x)}{\sqrt {1-\cos (x)} \sqrt {a-\cos (x)}}\right )}{\sqrt {1-\cos (x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 2775
Rule 4400
Rubi steps
\begin {align*} \int \sqrt {\frac {1-\cos (x)}{a-\cos (x)}} \, dx &=\frac {\left (\sqrt {\frac {1-\cos (x)}{a-\cos (x)}} \sqrt {a-\cos (x)}\right ) \int \frac {\sqrt {1-\cos (x)}}{\sqrt {a-\cos (x)}} \, dx}{\sqrt {1-\cos (x)}}\\ &=\frac {\left (2 \sqrt {\frac {1-\cos (x)}{a-\cos (x)}} \sqrt {a-\cos (x)}\right ) \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,\frac {\sin (x)}{\sqrt {1-\cos (x)} \sqrt {a-\cos (x)}}\right )}{\sqrt {1-\cos (x)}}\\ &=-\frac {2 \tan ^{-1}\left (\frac {\sin (x)}{\sqrt {1-\cos (x)} \sqrt {a-\cos (x)}}\right ) \sqrt {\frac {1-\cos (x)}{a-\cos (x)}} \sqrt {a-\cos (x)}}{\sqrt {1-\cos (x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.07, size = 64, normalized size = 0.98 \[ -\sqrt {2} \csc \left (\frac {x}{2}\right ) \sqrt {\frac {\cos (x)-1}{\cos (x)-a}} \sqrt {\cos (x)-a} \log \left (\sqrt {\cos (x)-a}+\sqrt {2} \cos \left (\frac {x}{2}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.47, size = 32, normalized size = 0.49 \[ -\arctan \left (-\frac {{\left (a - 2 \, \cos \relax (x) - 1\right )} \sqrt {-\frac {\cos \relax (x) - 1}{a - \cos \relax (x)}}}{2 \, \sin \relax (x)}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.86, size = 46, normalized size = 0.71 \[ 2 \, \arctan \left (\frac {1}{2} \, \sqrt {2} \sqrt {a \tan \left (\frac {1}{2} \, x\right )^{2} + \tan \left (\frac {1}{2} \, x\right )^{2} + a - 1}\right ) \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, x\right )^{3} + \tan \left (\frac {1}{2} \, x\right )\right ) \mathrm {sgn}\left (a - \cos \relax (x)\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.14, size = 67, normalized size = 1.03 \[ -\frac {\sqrt {2}\, \sqrt {\frac {-1+\cos \relax (x )}{-a +\cos \relax (x )}}\, \sin \relax (x ) \sqrt {-\frac {2 \left (-a +\cos \relax (x )\right )}{\cos \relax (x )+1}}\, \arctan \left (\frac {\sqrt {-\frac {2 \left (-a +\cos \relax (x )\right )}{\cos \relax (x )+1}}\, \sqrt {2}}{2}\right )}{-1+\cos \relax (x )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.02 \[ \int \sqrt {-\frac {\cos \relax (x)-1}{a-\cos \relax (x)}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {\frac {1 - \cos {\relax (x )}}{a - \cos {\relax (x )}}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________